#*******************************************************************
#* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        *
#*                                                                 *
#*  NOTE      = 通用函数模块
#*  DATE      = 
#*******************************************************************

#共通参数
include         ../apmmodule/Makefile_comm.mk

AR              = ar

INCLUDES        = -I. 
#LIBS           = -lzlog -luuid
CFLAGS          = -fPIC -DFR_MURMURHASH `xml2-config --cflags`

CFLAGS          += $(CFLAGS_EXT)
CFLAGS          += $(CFLAGS_UTEST)

#-DFR_MURMURHASH                使用murmurhash

ifdef DEFINE_C
MYCC = $(CC)
TARGET_LIB         =$(TARGET_LIB_APMCOMM_C)
else
MYCC = $(CX)
TARGET_LIB         =$(TARGET_LIB_APMCOMM)
endif

SRC  = $(wildcard *.c)
OBJS = $(patsubst %.c, %.o, $(SRC))

all: $(TARGET_LIB)

.c.o:$(OBJS)
	@$(MYCC) -c $(CFLAGS) $(INCLUDES)  $<

#$(TARGET_LIB): $(OBJS)
#	@cd $(NCX_DIST);make 
#	@$(AR) crv $@  $^ $(NCX_DIST)/ncx_slab.o

$(TARGET_LIB): $(OBJS)
	@$(AR) crv $@  $^ 
	@ranlib $@ 
	@rm -f *.o

clean:
	rm -f *.o *.a;
	# @cd $(NCX_DIST);make clean

install:
	mkdir -p $(COMM_DIST_DIR_DEV_SO);mkdir -p $(LIB_I_APM_COMM);
	cp $(TARGET_LIB) $(COMM_DIST_DIR_DEV_SO)/.
	cp *.h $(LIB_I_APM_COMM)/.

uninstall:
	rm -f $(LIB_A_APM_COMM);rm -rf $(LIB_I_APM_COMM)

#EOF

